Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughAdded square root functionality to the fixed-point math library by introducing a shared Changes
Sequence Diagram(s)sequenceDiagram
participant UD30x9 as UD30x9::sqrt()
participant SD29x9 as SD29x9::sqrt()
participant Helper as fp_helpers::sqrt_floor()
participant Newton as Newton Iteration
rect rgba(100, 150, 255, 0.5)
UD30x9->>Helper: sqrt_floor(raw * SCALE)
end
rect rgba(100, 200, 100, 0.5)
SD29x9->>Helper: sqrt_floor(magnitude * SCALE)
end
rect rgba(200, 100, 100, 0.5)
Helper->>Newton: Initial approximation + iterations
Newton->>Newton: (xn + a/xn) >> 1
Newton->>Helper: Refined result
end
Helper-->>UD30x9: floor(sqrt(a))
Helper-->>SD29x9: floor(sqrt(a))
UD30x9->>UD30x9: wrap(result)
SD29x9->>SD29x9: wrap(result as SD29x9)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #286 +/- ##
==========================================
+ Coverage 90.32% 95.23% +4.90%
==========================================
Files 21 21
Lines 1882 1910 +28
Branches 521 531 +10
==========================================
+ Hits 1700 1819 +119
+ Misses 160 69 -91
Partials 22 22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
0xNeshi
left a comment
There was a problem hiding this comment.
Looks good, a couple of small comments
ericnordelo
left a comment
There was a problem hiding this comment.
We still need to update the CHANGELOG, besides that it looks good to me.
bidzyyys
left a comment
There was a problem hiding this comment.
Looks good, my only concern is about the way you imported the openzeppelin-math library.
| edition = "2024" | ||
|
|
||
| [dependencies] | ||
| openzeppelin_math = { local = "../core" } |
There was a problem hiding this comment.
Shouldn't it be imported with 3 sections?
1.mainnet
2. testnet
3. dev-dependencies?
There was a problem hiding this comment.
This approach should copy/paste the function at deployment so there's no environment linking. What I had in mind was linking through the mvr not locally. But if we confirm with Sui (and we must before merging) that this indeed copies only the required function source code and not the whole math package we can continue with this approach.
Resolves #90
Summary by CodeRabbit
Release Notes
New Features
Tests